<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>8 模板语法-指令</title>
    <script src="js/vue.global.js"></script>
    <script src="https://unpkg.com/vue-router@4"></script>
    <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
</head>
<body>
<div id="app">
    {{ info }}
</div>

<script>
    const app = {
        data() {
            return {
                info: 'Ajax 测试!!'
            }
        },
        mounted () {
            axios
                .get('json_demo.json')
                .then(response => (this.info = response))
                .catch(function (error) { // 请求失败处理
                    console.log(error);
                });
        }
    }

    Vue.createApp(app).mount('#app')
</script>
</body>
</html>